home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
popupf
/
fixed.frm
< prev
next >
Wrap
Text File
|
1995-03-08
|
4KB
|
193 lines
VERSION 2.00
Begin Form Form1
BorderStyle = 3 'Fixed Double
Caption = "Fixed!"
ClientHeight = 3060
ClientLeft = 1080
ClientTop = 1740
ClientWidth = 3285
Height = 3750
Icon = FIXED.FRX:0000
Left = 1020
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3060
ScaleWidth = 3285
Top = 1110
Width = 3405
Begin Label Label2
Alignment = 2 'Center
BackColor = &H000000FF&
BorderStyle = 1 'Fixed Single
Caption = "Popup Menu5"
ForeColor = &H00FFFFFF&
Height = 1335
Left = 120
TabIndex = 1
Top = 1560
Width = 3015
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H00800000&
BorderStyle = 1 'Fixed Single
Caption = "Popup Menu4"
ForeColor = &H00FFFFFF&
Height = 1395
Left = 120
TabIndex = 0
Top = 120
Width = 3015
End
Begin Menu Menu1
Caption = "Menu 1"
Begin Menu Menu11
Caption = "Make Menu 2 Visible"
Enabled = 0 'False
End
Begin Menu Menu12
Caption = "Pop-up Menu 2"
End
Begin Menu mSep
Caption = "-"
End
Begin Menu mExit
Caption = "E&xit"
End
End
Begin Menu Menu2
Caption = "Menu 2"
Begin Menu Menu21
Caption = "Menu 2.1"
End
Begin Menu Menu22
Caption = "Make Menu 2 Invisible"
End
End
Begin Menu Menu3
Caption = "Menu 3"
Begin Menu Menu31
Caption = "Menu 3.1"
End
Begin Menu Menu32
Caption = "Menu 3.2"
End
Begin Menu Menu4
Caption = "Menu 4 (Invis. Popup)"
Visible = 0 'False
Begin Menu Menu41
Caption = "Menu 4.1"
End
Begin Menu Menu42
Caption = "Menu 4.2"
End
Begin Menu Menu43
Caption = "Menu 4.3"
End
End
Begin Menu Menu5
Caption = "Menu 5 (Invis. Popup)"
Visible = 0 'False
Begin Menu Menu51
Caption = "Menu 5.1"
End
Begin Menu Menu52
Caption = "Menu 5.2"
End
End
End
End
Option Explicit
Sub Form_Load ()
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
End Sub
Sub Label1_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
If (Button = 2) Then
Popup_Menu Menu4
End If
End Sub
Sub Label2_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
If (Button = 2) Then
Popup_Menu Menu5
End If
End Sub
Sub Menu11_Click ()
Menu2.Visible = True
Menu11.Enabled = False
Menu22.Enabled = True
End Sub
Sub Menu12_Click ()
If (Menu2.Visible = False) Then
Menu2.Visible = True
MsgBox "Make Menu 2 visible on the main bar if it is available anyway!"
End If
Menu22.Enabled = True
Menu11.Enabled = False
Popup_Menu Menu2
End Sub
Sub Menu21_Click ()
MsgBox "Menu 2.1"
End Sub
Sub Menu22_Click ()
MsgBox "Menu 2.1: Menu 2 will be invisible now."
Menu11.Enabled = True
Menu22.Enabled = False
Menu2.Visible = False
End Sub
Sub Menu41_Click ()
MsgBox "Menu 4.1!"
End Sub
Sub Menu51_Click ()
MsgBox "Menu 5.1!"
End Sub
Sub mExit_Click ()
Unload Me
End
End Sub
Sub Popup_Menu (m As Menu)
'Here, I left the other three parameters for PopUpMenu
'out, since I always use 4 (for example)
Menu4.Visible = True
Menu5.Visible = True
PopupMenu m, 4
Menu4.Visible = False
Menu5.Visible = False
End Sub